package com.heima.fegin.schedule;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.schedule.dto.TaskDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("leadnews-schedule")
public interface IScheduleClient {
    /**
     * 添加任务
     * @param taskDto   任务对象
     * @return       任务id
     */
    @PostMapping("/api/v1/schedule/addTask")
    public void addTask(@RequestBody TaskDto taskDto);


    /**
     * 按照类型和优先级来拉取任务
     * @param taskType
     * @param priority
     * @return
     */
    @PostMapping("/api/v1/schedule/pullTask/{taskType}/{priority}")
    public ResponseResult pullTask(@PathVariable Integer taskType,
                                   @PathVariable Integer priority);

}
